package com.ymttest.business.service.productdata.impl;

import java.util.Arrays;
import java.util.List;

import com.ymt.core.tool.Logger;
import com.ymttest.business.service.SellerProductCallService;
import com.ymttest.business.service.productdata.LiveOperate;
import com.ymttest.business.service.productdata.bean.ProductLivesBean;

public abstract class AbstractLiveService implements LiveOperate{

	protected void addProductinLives(int sellerId,String productId,List<Integer> lives){
		lives.forEach(live->{
			try {
				SellerProductCallService.addProductsInLive(sellerId,live,Arrays.asList(productId));
			} catch (Exception e) {
				Logger.fail(e);
			} 
		});
	}
		
	public ProductLivesBean addProductInLives(String productId){
		return doAddProductInLive(productId);
	};
	
	protected abstract ProductLivesBean doAddProductInLive(String productId);
	
}
